Repository navigation
fix: name the ref, the fault and the next steps when the pharn-oss archive is refused (CORE-388) - #447
Conversation
…chive is refused (CORE-388) A refused archive (a TarExtractError from the extractor, or a ManifestValidationError from the manifest/sha256/SKILLS_VERSION checks) printed only the check. fetchRepo now notes such a refusal with the ref it fetched (release tag + commit, or main + commit) and re-throws it unchanged; init, add, update and status ask lib/archive-refusal.ts for the message: the ref, that the published pharn-oss archive (not the project) is at fault, the original reason escaped, that no option skips the check, and only next steps the CLI has (--ref main / --ref latest, upgrade, report). PHARN_DEBUG=1 still dumps the raw error. Network and release-resolution errors pass through unchanged. Refs CORE-380 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🛡️ pharn-ci · ✅ PassTip Pass · Diff coverage of this change is 100% against a threshold of 80%; 33 agent setup files found.
🧪 Diff coverage
100% of changed lines covered (28/28, threshold 80%) Changed files (6)
🔍 Test integrityNo test-integrity findings (mode: block). Tests changed: +20 −0 ~0
🤖 Agent setup (33 files)Agent setup: 33 files · amp, claude-code, codex, copilot, cursor, jules, opencode, zed Agent setup files (33)
pharn-ci 0.12.0 · report schema v2 · coverage format lcov |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… archive (CORE-388) init, add and status stopped their spinner with "Failed to fetch" or "Failed to reach" even when the archive was downloaded and refused, which contradicted the new message. They now stop with "pharn-oss archive refused" when fetchRepo noted a refusal; any other failure keeps its line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep 0.21.7 above 0.21.6; re-apply the fetchRepo refusal note over the narrowed extractor; the command tests pin its new listed-path reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs CORE-380
What
During CORE-380 every user saw only
⚠ tar entry has an unsupported type '2': …, with nothing to say the published pharn-oss archive was at fault, that no flag gets past the check, or what to try.A refused archive now reads like this (release channel):
On
mainthe first line ispharn-oss main at commit <sha>(or(refs/heads/main, commit not resolved)), and the steps offer--ref latestand "re-run later, once main is fixed".--refaccepts onlymainandlatest, so no other value is suggested.How
src/lib/archive-refusal.ts.fetchRepo(lib/repo.ts) notes aTarExtractErrororManifestValidationError(exactly those two) with the ref it fetched, using a WeakMap. It then re-throws the error unchanged, soinstanceofcallers and the CORE-386 extractor rewrite keep their contract.fetchAtandtar-extract.tsare untouched.init,update(both the real run and the dry run),addandstatuspassarchiveRefusalMessage(err)as theCliError.failuremessage. The raw error stays the fatal cause, soPHARN_DEBUG=1dumps it (for exampleTarExtractError: …) in place of the hint.mainSHA (GitHub's answer, not an archive) are not noted, so their messages are unchanged.pharn.config.json, no.claude/and no lock left. The update test does the same.--force: an existing status test asserts that a refused fetch never mentions it.Tests
links), and the harness exposes it asupstream.links. The symlink sits at a manifest-declared path, so these tests stay valid once CORE-386 unpacks only listed paths.tests/commands/init.test.ts:--ref latestPHARN_DEBUG=1dumps the raw errortests/commands/update.test.ts: release run, and a main--dry-run.tests/archive-refusal.test.ts: which errors are noted (including network andReleaseResolveErrorpassing through), the malformed SHA, escaping, and that only--refvalues the CLI accepts appear.release-consistencygetsv0.21.5inKNOWN_TAGSplus the new link lines.Docs:
docs/troubleshooting.mdgets the new section "The pharn-oss archive was refused" and an updated example in "A pharn-oss release was refused". The module and test maps are updated, and the CHANGELOG has a 0.21.7 entry.Version: 0.21.7. 0.21.6 is reserved for CORE-386, so
package.json, the lock and the CHANGELOG will conflict with it; I'll renumber after whichever lands first.Local gates (format, lint, lint:md, typecheck, test:coverage, build) are all green.
🤖 Generated with Claude Code
Summary by CodeRabbit
maincommit was refused, why it was rejected, and confirm that project files were left unchanged.PHARN_DEBUG=1for the original error details.